From: Dario Faggioli Date: Thu, 7 Apr 2016 15:32:13 +0000 (+0200) Subject: xl: make return type of create_domain() more consistent. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1334 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=eeecf9d7615266bcbc0d26e1b73f0d906742cf51;p=xen.git xl: make return type of create_domain() more consistent. create_domain() is of uint32_t return type, because on success it returns the domid of the new domain, and uint32_t is what we typically use for domid-s. However, on failure, it returns ERROR_FAIL or ERROR_INVAL, which are -3 and -6. Callers assign the return value to an 'int rc' variable and then check for '(rc < 0)'. Although things work, and no tool (compiler, Coverity, ecc.) is complaining, using 'int' as return type seems better. Signed-off-by: Dario Faggioli Acked-by: Wei Liu --- diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index ac156fe9d2..63460175f0 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -2777,7 +2777,7 @@ static void evdisable_disk_ejects(libxl_evgen_disk_eject **diskws, } } -static uint32_t create_domain(struct domain_create *dom_info) +static int create_domain(struct domain_create *dom_info) { uint32_t domid = INVALID_DOMID;